package com.coffee.admin;

import com.coffee.system.service.ISysConfigService;
import com.coffee.system.service.ISysDictService;
import lombok.AllArgsConstructor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 项目初始化加载
 *
 * @author Kevin
 */
@Component
@AllArgsConstructor
public class StartUpRunner implements CommandLineRunner {

    private ISysDictService sysDictService;

    private ISysConfigService sysConfigService;

    @Override
    public void run(String... args) {
        System.out.println("============ 服务器启动中....，开始加载缓存数据 ============");
        sysDictService.loadAllDictCache();
        sysConfigService.loadAllConfig();
    }

}
